home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_finalcommiewaypoints.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  131 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_Funicular.cog
  4. #
  5. # This cog will play the funicular puzzle area in Vol.
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. #.......................MESSAGES....................
  15. message    user0
  16. message    timer
  17.  
  18. #.......................ACTORS....................
  19. thing    player                                                    local
  20.  
  21. thing    curFighter                                                local
  22.  
  23. #.......................WAYPOINT GHOSTS....................
  24. thing    wp_0
  25. thing    wp_1
  26. thing    wp_2
  27. thing    wp_3
  28. thing    wp_4
  29. thing    wp_5
  30. thing    wp_6
  31. thing    wp_7
  32. thing    wp_8
  33. thing    wp_9
  34. thing    wp_10
  35. thing    wp_11
  36. thing    wp_12
  37.  
  38. thing    clearghost
  39.  
  40. #.......................AI MOVE TARGETS....................
  41. thing    runoff_mv
  42.  
  43. #.......................EVENT LOCATIONS....................
  44. thing    wp_com_create
  45.             
  46. #.......................COGS....................
  47. cog        funicularCOG
  48.  
  49. #.......................TEMPLATES....................
  50. template    fighter0=jungle_tokarev                                local
  51. template    fighter1=jungle_mauser2                                local
  52. template    fighter2=agent_grenade4                                local
  53.  
  54. #.......................VARIABLES....................
  55. int        i_total=0                                                   local
  56. int        i_fakecount=0                                               local    # clearing existing waypoints
  57. int        i_realcount=0                                               local    # setting waypoint grid
  58. int        fightgen                                                   local    # randomize fighter creation
  59.                                                
  60.  
  61. end
  62. # ========================================================================================
  63. code
  64.  
  65. user0:
  66.  
  67. If (GetSenderRef() == funicularCOG)
  68.     {
  69.     
  70.     # clear any existing waypoints
  71.     for    (i_fakecount = 0; i_fakecount < 60; i_fakecount = i_fakecount + 1)
  72.         {
  73.         AISetWpnt(clearghost, i_fakecount);
  74.         }
  75.         Sleep(0.25);
  76.  
  77.     # set the new waypoint grid
  78.     for    (i_realcount = 0; i_realcount <= 12; i_realcount = i_realcount +1)
  79.         {
  80.         AISetWpnt(wp_0[i_realcount], i_realcount);
  81.         }
  82.     # connect the waypoints
  83.     AIConnectWpnts(0, 1);
  84.     AIConnectWpnts(1, 2);
  85.     AIConnectWpnts(2, 3);
  86.     AIConnectWpnts(2, 12);
  87.     AIConnectWpnts(3, 4);
  88.     AIConnectWpnts(4, 5);
  89.     AIConnectWpnts(5, 6);
  90.     AIConnectWpnts(6, 7);
  91.     AIConnectWpnts(7, 8);
  92.     AIConnectWpnts(8, 9);
  93.     AIConnectWpnts(9, 10);
  94.     AIConnectWpnts(10, 11);
  95.     AIConnectWpnts(11, 12);
  96.  
  97.     SetTimer(6.0);
  98.     }
  99. return;
  100. # ========================================================================================
  101. timer:
  102.  
  103. If (i_total == 10) return;        # no more than 10 commies will be created
  104.  
  105.     i_total = i_total + 1;
  106.     fightgen=RandBetween(0,2);    # randomize fighter type
  107.     
  108.     # fighter gets created and moved off ledge
  109.     curFighter[i_total]=CreateThing(fighter0[fightgen], wp_com_create);
  110.     CaptureThing(curFighter[i_total]);
  111.     AISetCutSceneMode(curFighter[i_total]);
  112.     AISetLookThing(curFighter[i_total], runoff_mv);
  113.     AISetMoveSpeed(curFighter[i_total], 2.5);
  114.     AISetMoveThing(curFighter[i_total], runoff_mv, 1);
  115.     AIClearCutSceneMode(curFighter[i_total]);
  116.     
  117.     # fighter gets on waypoint grid
  118.     AISetInstinctWpntMode(curFighter[i_total]); 
  119.     AIWpntHuntTarget(curFighter[i_total], 2.0, 0.0);
  120.  
  121.     SetTimer(6.0);
  122.  
  123. return;
  124. # ========================================================================================
  125. end
  126.  
  127.  
  128.  
  129.  
  130.  
  131.